﻿Cn_Businfo ={
	init : function(){
	//	if(!Jes.getUserSession(1)) return;//session
		this.query();

	}
	,query : function(){
		var id = Jes.request('id');
		Jes.query('business_query_sql@bus',{isSess:0,paraObj:"{id:'" + id + "'}",isLoad:false},function(data){
			Jes.html('busname','<ul>商家：</ul><li>'+ data[0].name +'</li>');
			Jes.html('buslogo','<a href="'+data[0].pic+'"><img src="" alt="'+data[0].name+'"></a>');
			Jes.html('topic','	<li>名称：'+ data[0].name +'</li><li>地址：'+data[0].address+'</li><li>电话：'+data[0].tel+'</li>');
			Jes.html('mapinfo', data[0].map);
			Jes.html('content', data[0].content);
            Cn_Businfo.initMap(data[0].latitude, data[0].longitude, data[0].name);
		});
	}
	,initMap: function(lat, lng, name) {
        var latLng = new google.maps.LatLng(lat, lng);
        var map = new google.maps.Map($('map_canvas'), {
            zoom: 15,
            center: latLng,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        });

        var marker = new google.maps.Marker({
            title: name,
            map: map,
            position: latLng
        });
//        this.geocoder = new google.maps.Geocoder();
    }
}
